<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2021-10-19 10:16:44
 * @Description: 用户日志，记录下每次登陆手机号与openid对应关系
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-10-21 15:06:53
 * @FilePath: /team_commission/database/migrations/shop/user/2021_10_19_101644_create_user_log.php
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserLog extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_logs', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->id();
            $table->foreignId('user_id')->comment('用户ID');
            $table->string('openid', 50)->nullable()->comment('openid');
            $table->char('phone', 11)->comment('手机号');
            $table->json('req_data')->nullable()->comment('提交的整体数据');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_logs');
    }
}
